home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / include / d3dcaps.h < prev    next >
C/C++ Source or Header  |  2001-10-16  |  26KB  |  600 lines

  1. /*==========================================================================;
  2.  *
  3.  *  Copyright (C) Microsoft Corporation.  All Rights Reserved. 
  4.  *
  5.  *  File:       d3dcaps.h
  6.  *  Content:    Direct3D capabilities include file
  7.  *
  8.  ***************************************************************************/
  9.  
  10. #ifndef _D3DCAPS_H
  11. #define _D3DCAPS_H
  12.  
  13. /*
  14.  *  Pull in DirectDraw include file automatically:
  15.  */
  16. #include "ddraw.h"
  17.  
  18. #ifndef DIRECT3D_VERSION
  19. #define DIRECT3D_VERSION         0x0700
  20. #endif
  21.  
  22. #pragma pack(4)
  23.  
  24. /* Description of capabilities of transform */
  25.  
  26. typedef struct _D3DTRANSFORMCAPS {
  27.     DWORD dwSize;
  28.     DWORD dwCaps;
  29. } D3DTRANSFORMCAPS, *LPD3DTRANSFORMCAPS;
  30.  
  31. #define D3DTRANSFORMCAPS_CLIP           0x00000001L /* Will clip whilst transforming */
  32.  
  33. /* Description of capabilities of lighting */
  34.  
  35. typedef struct _D3DLIGHTINGCAPS {
  36.     DWORD dwSize;
  37.     DWORD dwCaps;                   /* Lighting caps */
  38.     DWORD dwLightingModel;          /* Lighting model - RGB or mono */
  39.     DWORD dwNumLights;              /* Number of lights that can be handled */
  40. } D3DLIGHTINGCAPS, *LPD3DLIGHTINGCAPS;
  41.  
  42. #define D3DLIGHTINGMODEL_RGB            0x00000001L
  43. #define D3DLIGHTINGMODEL_MONO           0x00000002L
  44.  
  45. #define D3DLIGHTCAPS_POINT              0x00000001L /* Point lights supported */
  46. #define D3DLIGHTCAPS_SPOT               0x00000002L /* Spot lights supported */
  47. #define D3DLIGHTCAPS_DIRECTIONAL        0x00000004L /* Directional lights supported */
  48. #if(DIRECT3D_VERSION < 0x700)
  49. #define D3DLIGHTCAPS_PARALLELPOINT      0x00000008L /* Parallel point lights supported */
  50. #endif
  51. #if(DIRECT3D_VERSION < 0x500)
  52. #define D3DLIGHTCAPS_GLSPOT             0x00000010L /* GL syle spot lights supported */
  53. #endif
  54.  
  55. /* Description of capabilities for each primitive type */
  56.  
  57. typedef struct _D3DPrimCaps {
  58.     DWORD dwSize;
  59.     DWORD dwMiscCaps;                 /* Capability flags */
  60.     DWORD dwRasterCaps;
  61.     DWORD dwZCmpCaps;
  62.     DWORD dwSrcBlendCaps;
  63.     DWORD dwDestBlendCaps;
  64.     DWORD dwAlphaCmpCaps;
  65.     DWORD dwShadeCaps;
  66.     DWORD dwTextureCaps;
  67.     DWORD dwTextureFilterCaps;
  68.     DWORD dwTextureBlendCaps;
  69.     DWORD dwTextureAddressCaps;
  70.     DWORD dwStippleWidth;             /* maximum width and height of */
  71.     DWORD dwStippleHeight;            /* of supported stipple (up to 32x32) */
  72. } D3DPRIMCAPS, *LPD3DPRIMCAPS;
  73.  
  74. /* D3DPRIMCAPS dwMiscCaps */
  75.  
  76. #define D3DPMISCCAPS_MASKPLANES         0x00000001L
  77. #define D3DPMISCCAPS_MASKZ              0x00000002L
  78. #define D3DPMISCCAPS_LINEPATTERNREP     0x00000004L
  79. #define D3DPMISCCAPS_CONFORMANT         0x00000008L
  80. #define D3DPMISCCAPS_CULLNONE           0x00000010L
  81. #define D3DPMISCCAPS_CULLCW             0x00000020L
  82. #define D3DPMISCCAPS_CULLCCW            0x00000040L
  83.  
  84. /* D3DPRIMCAPS dwRasterCaps */
  85.  
  86. #define D3DPRASTERCAPS_DITHER                   0x00000001L
  87. #define D3DPRASTERCAPS_ROP2                     0x00000002L
  88. #define D3DPRASTERCAPS_XOR                      0x00000004L
  89. #define D3DPRASTERCAPS_PAT                      0x00000008L
  90. #define D3DPRASTERCAPS_ZTEST                    0x00000010L
  91. #define D3DPRASTERCAPS_SUBPIXEL                 0x00000020L
  92. #define D3DPRASTERCAPS_SUBPIXELX                0x00000040L
  93. #define D3DPRASTERCAPS_FOGVERTEX                0x00000080L
  94. #define D3DPRASTERCAPS_FOGTABLE                 0x00000100L
  95. #define D3DPRASTERCAPS_STIPPLE                  0x00000200L
  96. #if(DIRECT3D_VERSION >= 0x0500)
  97. #define D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT   0x00000400L
  98. #define D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT 0x00000800L
  99. #define D3DPRASTERCAPS_ANTIALIASEDGES           0x00001000L
  100. #define D3DPRASTERCAPS_MIPMAPLODBIAS            0x00002000L
  101. #define D3DPRASTERCAPS_ZBIAS                    0x00004000L
  102. #define D3DPRASTERCAPS_ZBUFFERLESSHSR           0x00008000L
  103. #define D3DPRASTERCAPS_FOGRANGE                 0x00010000L
  104. #define D3DPRASTERCAPS_ANISOTROPY               0x00020000L
  105. #endif /* DIRECT3D_VERSION >= 0x0500 */
  106. #if(DIRECT3D_VERSION >= 0x0600)
  107. #define D3DPRASTERCAPS_WBUFFER                      0x00040000L
  108. #define D3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT   0x00080000L
  109. #define D3DPRASTERCAPS_WFOG                         0x00100000L
  110. #define D3DPRASTERCAPS_ZFOG                         0x00200000L
  111. #endif /* DIRECT3D_VERSION >= 0x0600 */
  112.  
  113. /* D3DPRIMCAPS dwZCmpCaps, dwAlphaCmpCaps */
  114.  
  115. #define D3DPCMPCAPS_NEVER               0x00000001L
  116. #define D3DPCMPCAPS_LESS                0x00000002L
  117. #define D3DPCMPCAPS_EQUAL               0x00000004L
  118. #define D3DPCMPCAPS_LESSEQUAL           0x00000008L
  119. #define D3DPCMPCAPS_GREATER             0x00000010L
  120. #define D3DPCMPCAPS_NOTEQUAL            0x00000020L
  121. #define D3DPCMPCAPS_GREATEREQUAL        0x00000040L
  122. #define D3DPCMPCAPS_ALWAYS              0x00000080L
  123.  
  124. /* D3DPRIMCAPS dwSourceBlendCaps, dwDestBlendCaps */
  125.  
  126. #define D3DPBLENDCAPS_ZERO              0x00000001L
  127. #define D3DPBLENDCAPS_ONE               0x00000002L
  128. #define D3DPBLENDCAPS_SRCCOLOR          0x00000004L
  129. #define D3DPBLENDCAPS_INVSRCCOLOR       0x00000008L
  130. #define D3DPBLENDCAPS_SRCALPHA          0x00000010L
  131. #define D3DPBLENDCAPS_INVSRCALPHA       0x00000020L
  132. #define D3DPBLENDCAPS_DESTALPHA         0x00000040L
  133. #define D3DPBLENDCAPS_INVDESTALPHA      0x00000080L
  134. #define D3DPBLENDCAPS_DESTCOLOR         0x00000100L
  135. #define D3DPBLENDCAPS_INVDESTCOLOR      0x00000200L
  136. #define D3DPBLENDCAPS_SRCALPHASAT       0x00000400L
  137. #define D3DPBLENDCAPS_BOTHSRCALPHA      0x00000800L
  138. #define D3DPBLENDCAPS_BOTHINVSRCALPHA   0x00001000L
  139.  
  140. /* D3DPRIMCAPS dwShadeCaps */
  141.  
  142. #define D3DPSHADECAPS_COLORFLATMONO             0x00000001L
  143. #define D3DPSHADECAPS_COLORFLATRGB              0x00000002L
  144. #define D3DPSHADECAPS_COLORGOURAUDMONO          0x00000004L
  145. #define D3DPSHADECAPS_COLORGOURAUDRGB           0x00000008L
  146. #define D3DPSHADECAPS_COLORPHONGMONO            0x00000010L
  147. #define D3DPSHADECAPS_COLORPHONGRGB             0x00000020L
  148.  
  149. #define D3DPSHADECAPS_SPECULARFLATMONO          0x00000040L
  150. #define D3DPSHADECAPS_SPECULARFLATRGB           0x00000080L
  151. #define D3DPSHADECAPS_SPECULARGOURAUDMONO       0x00000100L
  152. #define D3DPSHADECAPS_SPECULARGOURAUDRGB        0x00000200L
  153. #define D3DPSHADECAPS_SPECULARPHONGMONO         0x00000400L
  154. #define D3DPSHADECAPS_SPECULARPHONGRGB          0x00000800L
  155.  
  156. #define D3DPSHADECAPS_ALPHAFLATBLEND            0x00001000L
  157. #define D3DPSHADECAPS_ALPHAFLATSTIPPLED         0x00002000L
  158. #define D3DPSHADECAPS_ALPHAGOURAUDBLEND         0x00004000L
  159. #define D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED      0x00008000L
  160. #define D3DPSHADECAPS_ALPHAPHONGBLEND           0x00010000L
  161. #define D3DPSHADECAPS_ALPHAPHONGSTIPPLED        0x00020000L
  162.  
  163. #define D3DPSHADECAPS_FOGFLAT                   0x00040000L
  164. #define D3DPSHADECAPS_FOGGOURAUD                0x00080000L
  165. #define D3DPSHADECAPS_FOGPHONG                  0x00100000L
  166.  
  167. /* D3DPRIMCAPS dwTextureCaps */
  168.  
  169. /*
  170.  * Perspective-correct texturing is supported
  171.  */
  172. #define D3DPTEXTURECAPS_PERSPECTIVE     0x00000001L
  173.  
  174. /*
  175.  * Power-of-2 texture dimensions are required
  176.  */
  177. #define D3DPTEXTURECAPS_POW2            0x00000002L
  178.  
  179. /*
  180.  * Alpha in texture pixels is supported
  181.  */
  182. #define D3DPTEXTURECAPS_ALPHA           0x00000004L
  183.  
  184. /*
  185.  * Color-keyed textures are supported
  186.  */
  187. #define D3DPTEXTURECAPS_TRANSPARENCY    0x00000008L
  188.  
  189. /*
  190.  * obsolete, see D3DPTADDRESSCAPS_BORDER
  191.  */
  192. #define D3DPTEXTURECAPS_BORDER          0x00000010L
  193.  
  194. /*
  195.  * Only square textures are supported
  196.  */
  197. #define D3DPTEXTURECAPS_SQUAREONLY      0x00000020L
  198.  
  199. #if(DIRECT3D_VERSION >= 0x0600)
  200. /*
  201.  * Texture indices are not scaled by the texture size prior
  202.  * to interpolation.
  203.  */
  204. #define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L
  205.  
  206. /*
  207.  * Device can draw alpha from texture palettes
  208.  */
  209. #define D3DPTEXTURECAPS_ALPHAPALETTE    0x00000080L
  210.  
  211. /*
  212.  * Device can use non-POW2 textures if:
  213.  *  1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage
  214.  *  2) D3DRS_WRAP(N) is zero for this texture's coordinates
  215.  *  3) mip mapping is not enabled (use magnification filter only)
  216.  */
  217. #define D3DPTEXTURECAPS_NONPOW2CONDITIONAL  0x00000100L
  218.  
  219. #endif /* DIRECT3D_VERSION >= 0x0600 */
  220. #if(DIRECT3D_VERSION >= 0x0700)
  221.  
  222. // 0x00000200L unused
  223.  
  224. /*
  225.  * Device can divide transformed texture coordinates by the
  226.  * COUNTth texture coordinate (can do D3DTTFF_PROJECTED)
  227.  */
  228. #define D3DPTEXTURECAPS_PROJECTED  0x00000400L
  229.  
  230. /*
  231.  * Device can do cubemap textures
  232.  */
  233. #define D3DPTEXTURECAPS_CUBEMAP           0x00000800L
  234.  
  235. #define D3DPTEXTURECAPS_COLORKEYBLEND     0x00001000L
  236. #endif /* DIRECT3D_VERSION >= 0x0700 */
  237.  
  238. /* D3DPRIMCAPS dwTextureFilterCaps */
  239.  
  240. #define D3DPTFILTERCAPS_NEAREST         0x00000001L
  241. #define D3DPTFILTERCAPS_LINEAR          0x00000002L
  242. #define D3DPTFILTERCAPS_MIPNEAREST      0x00000004L
  243. #define D3DPTFILTERCAPS_MIPLINEAR       0x00000008L
  244. #define D3DPTFILTERCAPS_LINEARMIPNEAREST 0x00000010L
  245. #define D3DPTFILTERCAPS_LINEARMIPLINEAR 0x00000020L
  246.  
  247. #if(DIRECT3D_VERSION >= 0x0600)
  248. /* Device3 Min Filter */
  249. #define D3DPTFILTERCAPS_MINFPOINT       0x00000100L
  250. #define D3DPTFILTERCAPS_MINFLINEAR      0x00000200L
  251. #define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400L
  252.  
  253. /* Device3 Mip Filter */
  254. #define D3DPTFILTERCAPS_MIPFPOINT       0x00010000L
  255. #define D3DPTFILTERCAPS_MIPFLINEAR      0x00020000L
  256.  
  257. /* Device3 Mag Filter */
  258. #define D3DPTFILTERCAPS_MAGFPOINT         0x01000000L
  259. #define D3DPTFILTERCAPS_MAGFLINEAR        0x02000000L
  260. #define D3DPTFILTERCAPS_MAGFANISOTROPIC   0x04000000L
  261. #define D3DPTFILTERCAPS_MAGFAFLATCUBIC    0x08000000L
  262. #define D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC 0x10000000L
  263. #endif /* DIRECT3D_VERSION >= 0x0600 */
  264.  
  265. /* D3DPRIMCAPS dwTextureBlendCaps */
  266.  
  267. #define D3DPTBLENDCAPS_DECAL            0x00000001L
  268. #define D3DPTBLENDCAPS_MODULATE         0x00000002L
  269. #define D3DPTBLENDCAPS_DECALALPHA       0x00000004L
  270. #define D3DPTBLENDCAPS_MODULATEALPHA    0x00000008L
  271. #define D3DPTBLENDCAPS_DECALMASK        0x00000010L
  272. #define D3DPTBLENDCAPS_MODULATEMASK     0x00000020L
  273. #define D3DPTBLENDCAPS_COPY             0x00000040L
  274. #if(DIRECT3D_VERSION >= 0x0500)
  275. #define D3DPTBLENDCAPS_ADD              0x00000080L
  276. #endif /* DIRECT3D_VERSION >= 0x0500 */
  277.  
  278. /* D3DPRIMCAPS dwTextureAddressCaps */
  279. #define D3DPTADDRESSCAPS_WRAP           0x00000001L
  280. #define D3DPTADDRESSCAPS_MIRROR         0x00000002L
  281. #define D3DPTADDRESSCAPS_CLAMP          0x00000004L
  282. #if(DIRECT3D_VERSION >= 0x0500)
  283. #define D3DPTADDRESSCAPS_BORDER         0x00000008L
  284. #define D3DPTADDRESSCAPS_INDEPENDENTUV  0x00000010L
  285. #endif /* DIRECT3D_VERSION >= 0x0500 */
  286.  
  287. #if(DIRECT3D_VERSION >= 0x0600)
  288.  
  289. /* D3DDEVICEDESC dwStencilCaps */
  290.  
  291. #define D3DSTENCILCAPS_KEEP     0x00000001L
  292. #define D3DSTENCILCAPS_ZERO     0x00000002L
  293. #define D3DSTENCILCAPS_REPLACE  0x00000004L
  294. #define D3DSTENCILCAPS_INCRSAT  0x00000008L
  295. #define D3DSTENCILCAPS_DECRSAT  0x00000010L
  296. #define D3DSTENCILCAPS_INVERT   0x00000020L
  297. #define D3DSTENCILCAPS_INCR     0x00000040L
  298. #define D3DSTENCILCAPS_DECR     0x00000080L
  299.  
  300. /* D3DDEVICEDESC dwTextureOpCaps */
  301.  
  302. #define D3DTEXOPCAPS_DISABLE                    0x00000001L
  303. #define D3DTEXOPCAPS_SELECTARG1                 0x00000002L
  304. #define D3DTEXOPCAPS_SELECTARG2                 0x00000004L
  305. #define D3DTEXOPCAPS_MODULATE                   0x00000008L
  306. #define D3DTEXOPCAPS_MODULATE2X                 0x00000010L
  307. #define D3DTEXOPCAPS_MODULATE4X                 0x00000020L
  308. #define D3DTEXOPCAPS_ADD                        0x00000040L
  309. #define D3DTEXOPCAPS_ADDSIGNED                  0x00000080L
  310. #define D3DTEXOPCAPS_ADDSIGNED2X                0x00000100L
  311. #define D3DTEXOPCAPS_SUBTRACT                   0x00000200L
  312. #define D3DTEXOPCAPS_ADDSMOOTH                  0x00000400L
  313. #define D3DTEXOPCAPS_BLENDDIFFUSEALPHA          0x00000800L
  314. #define D3DTEXOPCAPS_BLENDTEXTUREALPHA          0x00001000L
  315. #define D3DTEXOPCAPS_BLENDFACTORALPHA           0x00002000L
  316. #define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM        0x00004000L
  317. #define D3DTEXOPCAPS_BLENDCURRENTALPHA          0x00008000L
  318. #define D3DTEXOPCAPS_PREMODULATE                0x00010000L
  319. #define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR     0x00020000L
  320. #define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA     0x00040000L
  321. #define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR  0x00080000L
  322. #define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA  0x00100000L
  323. #define D3DTEXOPCAPS_BUMPENVMAP                 0x00200000L
  324. #define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE        0x00400000L
  325. #define D3DTEXOPCAPS_DOTPRODUCT3                0x00800000L
  326.  
  327. /* D3DDEVICEDESC dwFVFCaps flags */
  328.  
  329. #define D3DFVFCAPS_TEXCOORDCOUNTMASK    0x0000ffffL /* mask for texture coordinate count field */
  330. #define D3DFVFCAPS_DONOTSTRIPELEMENTS   0x00080000L /* Device prefers that vertex elements not be stripped */
  331.  
  332. #endif /* DIRECT3D_VERSION >= 0x0600 */
  333.  
  334. /*
  335.  * Description for a device.
  336.  * This is used to describe a device that is to be created or to query
  337.  * the current device.
  338.  */
  339. typedef struct _D3DDeviceDesc {
  340.     DWORD            dwSize;                 /* Size of D3DDEVICEDESC structure */
  341.     DWORD            dwFlags;                /* Indicates which fields have valid data */
  342.     D3DCOLORMODEL    dcmColorModel;          /* Color model of device */
  343.     DWORD            dwDevCaps;              /* Capabilities of device */
  344.     D3DTRANSFORMCAPS dtcTransformCaps;       /* Capabilities of transform */
  345.     BOOL             bClipping;              /* Device can do 3D clipping */
  346.     D3DLIGHTINGCAPS  dlcLightingCaps;        /* Capabilities of lighting */
  347.     D3DPRIMCAPS      dpcLineCaps;
  348.     D3DPRIMCAPS      dpcTriCaps;
  349.     DWORD            dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */
  350.     DWORD            dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */
  351.     DWORD            dwMaxBufferSize;        /* Maximum execute buffer size */
  352.     DWORD            dwMaxVertexCount;       /* Maximum vertex count */
  353. #if(DIRECT3D_VERSION >= 0x0500)
  354.     // *** New fields for DX5 *** //
  355.  
  356.     // Width and height caps are 0 for legacy HALs.
  357.     DWORD        dwMinTextureWidth, dwMinTextureHeight;
  358.     DWORD        dwMaxTextureWidth, dwMaxTextureHeight;
  359.     DWORD        dwMinStippleWidth, dwMaxStippleWidth;
  360.     DWORD        dwMinStippleHeight, dwMaxStippleHeight;
  361. #endif /* DIRECT3D_VERSION >= 0x0500 */
  362.  
  363. #if(DIRECT3D_VERSION >= 0x0600)
  364.     // New fields for DX6
  365.     DWORD       dwMaxTextureRepeat;
  366.     DWORD       dwMaxTextureAspectRatio;
  367.     DWORD       dwMaxAnisotropy;
  368.  
  369.     // Guard band that the rasterizer can accommodate
  370.     // Screen-space vertices inside this space but outside the viewport
  371.     // will get clipped properly.
  372.     D3DVALUE    dvGuardBandLeft;
  373.     D3DVALUE    dvGuardBandTop;
  374.     D3DVALUE    dvGuardBandRight;
  375.     D3DVALUE    dvGuardBandBottom;
  376.  
  377.     D3DVALUE    dvExtentsAdjust;
  378.     DWORD       dwStencilCaps;
  379.  
  380.     DWORD       dwFVFCaps;
  381.     DWORD       dwTextureOpCaps;
  382.     WORD        wMaxTextureBlendStages;
  383.     WORD        wMaxSimultaneousTextures;
  384. #endif /* DIRECT3D_VERSION >= 0x0600 */
  385. } D3DDEVICEDESC, *LPD3DDEVICEDESC;
  386.  
  387. #if(DIRECT3D_VERSION >= 0x0700)
  388. typedef struct _D3DDeviceDesc7 {
  389.     DWORD            dwDevCaps;              /* Capabilities of device */
  390.     D3DPRIMCAPS      dpcLineCaps;
  391.     D3DPRIMCAPS      dpcTriCaps;
  392.     DWORD            dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */
  393.     DWORD            dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */
  394.  
  395.     DWORD       dwMinTextureWidth, dwMinTextureHeight;
  396.     DWORD       dwMaxTextureWidth, dwMaxTextureHeight;
  397.  
  398.     DWORD       dwMaxTextureRepeat;
  399.     DWORD       dwMaxTextureAspectRatio;
  400.     DWORD       dwMaxAnisotropy;
  401.  
  402.     D3DVALUE    dvGuardBandLeft;
  403.     D3DVALUE    dvGuardBandTop;
  404.     D3DVALUE    dvGuardBandRight;
  405.     D3DVALUE    dvGuardBandBottom;
  406.  
  407.     D3DVALUE    dvExtentsAdjust;
  408.     DWORD       dwStencilCaps;
  409.  
  410.     DWORD       dwFVFCaps;
  411.     DWORD       dwTextureOpCaps;
  412.     WORD        wMaxTextureBlendStages;
  413.     WORD        wMaxSimultaneousTextures;
  414.  
  415.     DWORD       dwMaxActiveLights;
  416.     D3DVALUE    dvMaxVertexW;
  417.     GUID        deviceGUID;
  418.  
  419.     WORD        wMaxUserClipPlanes;
  420.     WORD        wMaxVertexBlendMatrices;
  421.  
  422.     DWORD       dwVertexProcessingCaps;
  423.  
  424.     DWORD       dwReserved1;
  425.     DWORD       dwReserved2;
  426.     DWORD       dwReserved3;
  427.     DWORD       dwReserved4;
  428. } D3DDEVICEDESC7, *LPD3DDEVICEDESC7;
  429. #endif /* DIRECT3D_VERSION >= 0x0700 */
  430.  
  431. #define D3DDEVICEDESCSIZE (sizeof(D3DDEVICEDESC))
  432. #define D3DDEVICEDESC7SIZE (sizeof(D3DDEVICEDESC7))
  433.  
  434. typedef HRESULT (CALLBACK * LPD3DENUMDEVICESCALLBACK)(GUID FAR *lpGuid, LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC, LPD3DDEVICEDESC, LPVOID);
  435.  
  436. #if(DIRECT3D_VERSION >= 0x0700)
  437. typedef HRESULT (CALLBACK * LPD3DENUMDEVICESCALLBACK7)(LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC7, LPVOID);
  438. #endif /* DIRECT3D_VERSION >= 0x0700 */
  439.  
  440. /* D3DDEVICEDESC dwFlags indicating valid fields */
  441.  
  442. #define D3DDD_COLORMODEL            0x00000001L /* dcmColorModel is valid */
  443. #define D3DDD_DEVCAPS               0x00000002L /* dwDevCaps is valid */
  444. #define D3DDD_TRANSFORMCAPS         0x00000004L /* dtcTransformCaps is valid */
  445. #define D3DDD_LIGHTINGCAPS          0x00000008L /* dlcLightingCaps is valid */
  446. #define D3DDD_BCLIPPING             0x00000010L /* bClipping is valid */
  447. #define D3DDD_LINECAPS              0x00000020L /* dpcLineCaps is valid */
  448. #define D3DDD_TRICAPS               0x00000040L /* dpcTriCaps is valid */
  449. #define D3DDD_DEVICERENDERBITDEPTH  0x00000080L /* dwDeviceRenderBitDepth is valid */
  450. #define D3DDD_DEVICEZBUFFERBITDEPTH 0x00000100L /* dwDeviceZBufferBitDepth is valid */
  451. #define D3DDD_MAXBUFFERSIZE         0x00000200L /* dwMaxBufferSize is valid */
  452. #define D3DDD_MAXVERTEXCOUNT        0x00000400L /* dwMaxVertexCount is valid */
  453.  
  454. /* D3DDEVICEDESC dwDevCaps flags */
  455.  
  456. #define D3DDEVCAPS_FLOATTLVERTEX        0x00000001L /* Device accepts floating point */
  457.                                                     /* for post-transform vertex data */
  458. #define D3DDEVCAPS_SORTINCREASINGZ      0x00000002L /* Device needs data sorted for increasing Z */
  459. #define D3DDEVCAPS_SORTDECREASINGZ      0X00000004L /* Device needs data sorted for decreasing Z */
  460. #define D3DDEVCAPS_SORTEXACT            0x00000008L /* Device needs data sorted exactly */
  461.  
  462. #define D3DDEVCAPS_EXECUTESYSTEMMEMORY  0x00000010L /* Device can use execute buffers from system memory */
  463. #define D3DDEVCAPS_EXECUTEVIDEOMEMORY   0x00000020L /* Device can use execute buffers from video memory */
  464. #define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */
  465. #define D3DDEVCAPS_TLVERTEXVIDEOMEMORY  0x00000080L /* Device can use TL buffers from video memory */
  466. #define D3DDEVCAPS_TEXTURESYSTEMMEMORY  0x00000100L /* Device can texture from system memory */
  467. #define D3DDEVCAPS_TEXTUREVIDEOMEMORY   0x00000200L /* Device can texture from device memory */
  468. #if(DIRECT3D_VERSION >= 0x0500)
  469. #define D3DDEVCAPS_DRAWPRIMTLVERTEX     0x00000400L /* Device can draw TLVERTEX primitives */
  470. #define D3DDEVCAPS_CANRENDERAFTERFLIP   0x00000800L /* Device can render without waiting for flip to complete */
  471. #define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */
  472. #endif /* DIRECT3D_VERSION >= 0x0500 */
  473. #if(DIRECT3D_VERSION >= 0x0600)
  474. #define D3DDEVCAPS_DRAWPRIMITIVES2         0x00002000L /* Device can support DrawPrimitives2 */
  475. #define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x00004000L /* Device is texturing from separate memory pools */
  476. #define D3DDEVCAPS_DRAWPRIMITIVES2EX       0x00008000L /* Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver*/
  477. #endif /* DIRECT3D_VERSION >= 0x0600 */
  478. #if(DIRECT3D_VERSION >= 0x0700)
  479. #define D3DDEVCAPS_HWTRANSFORMANDLIGHT     0x00010000L /* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also */
  480. #define D3DDEVCAPS_CANBLTSYSTONONLOCAL     0x00020000L /* Device supports a Tex Blt from system memory to non-local vidmem */
  481. #define D3DDEVCAPS_HWRASTERIZATION         0x00080000L /* Device has HW acceleration for rasterization */
  482.  
  483. /*
  484.  * These are the flags in the D3DDEVICEDESC7.dwVertexProcessingCaps field
  485.  */
  486.  
  487. /* device can do texgen */
  488. #define D3DVTXPCAPS_TEXGEN              0x00000001L
  489. /* device can do IDirect3DDevice7 colormaterialsource ops */
  490. #define D3DVTXPCAPS_MATERIALSOURCE7     0x00000002L
  491. /* device can do vertex fog */
  492. #define D3DVTXPCAPS_VERTEXFOG           0x00000004L
  493. /* device can do directional lights */
  494. #define D3DVTXPCAPS_DIRECTIONALLIGHTS   0x00000008L
  495. /* device can do positional lights (includes point and spot) */
  496. #define D3DVTXPCAPS_POSITIONALLIGHTS    0x00000010L
  497. /* device can do local viewer */
  498. #define D3DVTXPCAPS_LOCALVIEWER         0x00000020L
  499.  
  500. #endif /* DIRECT3D_VERSION >= 0x0700 */
  501.  
  502. #define D3DFDS_COLORMODEL        0x00000001L /* Match color model */
  503. #define D3DFDS_GUID              0x00000002L /* Match guid */
  504. #define D3DFDS_HARDWARE          0x00000004L /* Match hardware/software */
  505. #define D3DFDS_TRIANGLES         0x00000008L /* Match in triCaps */
  506. #define D3DFDS_LINES             0x00000010L /* Match in lineCaps  */
  507. #define D3DFDS_MISCCAPS          0x00000020L /* Match primCaps.dwMiscCaps */
  508. #define D3DFDS_RASTERCAPS        0x00000040L /* Match primCaps.dwRasterCaps */
  509. #define D3DFDS_ZCMPCAPS          0x00000080L /* Match primCaps.dwZCmpCaps */
  510. #define D3DFDS_ALPHACMPCAPS      0x00000100L /* Match primCaps.dwAlphaCmpCaps */
  511. #define D3DFDS_SRCBLENDCAPS      0x00000200L /* Match primCaps.dwSourceBlendCaps */
  512. #define D3DFDS_DSTBLENDCAPS      0x00000400L /* Match primCaps.dwDestBlendCaps */
  513. #define D3DFDS_SHADECAPS         0x00000800L /* Match primCaps.dwShadeCaps */
  514. #define D3DFDS_TEXTURECAPS       0x00001000L /* Match primCaps.dwTextureCaps */
  515. #define D3DFDS_TEXTUREFILTERCAPS 0x00002000L /* Match primCaps.dwTextureFilterCaps */
  516. #define D3DFDS_TEXTUREBLENDCAPS  0x00004000L /* Match primCaps.dwTextureBlendCaps */
  517. #define D3DFDS_TEXTUREADDRESSCAPS  0x00008000L /* Match primCaps.dwTextureBlendCaps */
  518.  
  519. /*
  520.  * FindDevice arguments
  521.  */
  522. typedef struct _D3DFINDDEVICESEARCH {
  523.     DWORD               dwSize;
  524.     DWORD               dwFlags;
  525.     BOOL                bHardware;
  526.     D3DCOLORMODEL       dcmColorModel;
  527.     GUID                guid;
  528.     DWORD               dwCaps;
  529.     D3DPRIMCAPS         dpcPrimCaps;
  530. } D3DFINDDEVICESEARCH, *LPD3DFINDDEVICESEARCH;
  531.  
  532. typedef struct _D3DFINDDEVICERESULT {
  533.     DWORD               dwSize;
  534.     GUID                guid;           /* guid which matched */
  535.     D3DDEVICEDESC       ddHwDesc;       /* hardware D3DDEVICEDESC */
  536.     D3DDEVICEDESC       ddSwDesc;       /* software D3DDEVICEDESC */
  537. } D3DFINDDEVICERESULT, *LPD3DFINDDEVICERESULT;
  538.  
  539. /*
  540.  * Description of execute buffer.
  541.  */
  542. typedef struct _D3DExecuteBufferDesc {
  543.     DWORD               dwSize;         /* size of this structure */
  544.     DWORD               dwFlags;        /* flags indicating which fields are valid */
  545.     DWORD               dwCaps;         /* capabilities of execute buffer */
  546.     DWORD               dwBufferSize;   /* size of execute buffer data */
  547.     LPVOID              lpData;         /* pointer to actual data */
  548. } D3DEXECUTEBUFFERDESC, *LPD3DEXECUTEBUFFERDESC;
  549.  
  550. /* D3DEXECUTEBUFFER dwFlags indicating valid fields */
  551.  
  552. #define D3DDEB_BUFSIZE          0x00000001l     /* buffer size valid */
  553. #define D3DDEB_CAPS             0x00000002l     /* caps valid */
  554. #define D3DDEB_LPDATA           0x00000004l     /* lpData valid */
  555.  
  556. /* D3DEXECUTEBUFFER dwCaps */
  557.  
  558. #define D3DDEBCAPS_SYSTEMMEMORY 0x00000001l     /* buffer in system memory */
  559. #define D3DDEBCAPS_VIDEOMEMORY  0x00000002l     /* buffer in device memory */
  560. #define D3DDEBCAPS_MEM (D3DDEBCAPS_SYSTEMMEMORY|D3DDEBCAPS_VIDEOMEMORY)
  561.  
  562. #if(DIRECT3D_VERSION < 0x0800)
  563.  
  564. #if(DIRECT3D_VERSION >= 0x0700)
  565. typedef struct _D3DDEVINFO_TEXTUREMANAGER {
  566.     BOOL    bThrashing;                 /* indicates if thrashing */
  567.     DWORD   dwApproxBytesDownloaded;    /* Approximate number of bytes downloaded by texture manager */
  568.     DWORD   dwNumEvicts;                /* number of textures evicted */
  569.     DWORD   dwNumVidCreates;            /* number of textures created in video memory */
  570.     DWORD   dwNumTexturesUsed;          /* number of textures used */
  571.     DWORD   dwNumUsedTexInVid;          /* number of used textures present in video memory */
  572.     DWORD   dwWorkingSet;               /* number of textures in video memory */
  573.     DWORD   dwWorkingSetBytes;          /* number of bytes in video memory */
  574.     DWORD   dwTotalManaged;             /* total number of managed textures */
  575.     DWORD   dwTotalBytes;               /* total number of bytes of managed textures */
  576.     DWORD   dwLastPri;                  /* priority of last texture evicted */
  577. } D3DDEVINFO_TEXTUREMANAGER, *LPD3DDEVINFO_TEXTUREMANAGER;
  578.  
  579. typedef struct _D3DDEVINFO_TEXTURING {
  580.     DWORD   dwNumLoads;                 /* counts Load() API calls */
  581.     DWORD   dwApproxBytesLoaded;        /* Approximate number bytes loaded via Load() */
  582.     DWORD   dwNumPreLoads;              /* counts PreLoad() API calls */
  583.     DWORD   dwNumSet;                   /* counts SetTexture() API calls */
  584.     DWORD   dwNumCreates;               /* counts texture creates */
  585.     DWORD   dwNumDestroys;              /* counts texture destroys */
  586.     DWORD   dwNumSetPriorities;         /* counts SetPriority() API calls */
  587.     DWORD   dwNumSetLODs;               /* counts SetLOD() API calls */
  588.     DWORD   dwNumLocks;                 /* counts number of texture locks */
  589.     DWORD   dwNumGetDCs;                /* counts number of GetDCs to textures */
  590. } D3DDEVINFO_TEXTURING, *LPD3DDEVINFO_TEXTURING;
  591. #endif /* DIRECT3D_VERSION >= 0x0700 */
  592.  
  593. #endif //(DIRECT3D_VERSION < 0x0800)
  594.  
  595. #pragma pack()
  596.  
  597.  
  598. #endif /* _D3DCAPS_H_ */
  599.  
  600.